@extends('extend.admin')
@section('title','博文修改')
@section('content')
<section id="main-content">
    <div class="row">
        <div class="col-md-12">
            <!--breadcrumbs start -->
            <ul class="breadcrumb">
                <li><a href="/admin">首页</a>
                </li>
                <li>博文管理</li>
                <li class="active">修改文章</li>
            </ul>
            <!--breadcrumbs end -->
            <h1 class="h1">修改文章</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
        <form action="/article/update" method="post" enctype="multipart/form-data">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">编辑文章</h3>
                </div>
                <div class="panel-body">
                    <div class="col-md-12">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label for="exampleInputEmail2">文章标题</label>
                                <input type="text" name="title" class="form-control" id="exampleInputEmail2" value="{{$article->title}}">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="col-md-12" style="padding:20px;15px">
                        <label for="exampleInputEmail2">文章分类</label>
                            <input type="text" readonly class="form-control" id="exampleInputEmail2" value="{{$cate->name}}">
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="col-md-12">
                        <label for="exampleInputEmail2">文章状态</label>
                            发布&nbsp;:&nbsp;<input type="radio"  name="status" value="1" @if($article->status==1) checked @endif>&nbsp;&nbsp;&nbsp;&nbsp;
                            草稿&nbsp;:&nbsp;<input type="radio" name="status" value="0" @if($article->status==0) checked @endif>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">文章内容</h3>
                </div>
                <div class="panel-body">
                    <div class="form-group">
                        <!-- 加载编辑器的容器 -->
                        <script id="editor" name="content" type="text/plain" style="width:100%;height:300px;">{!! $article->content !!}</script>
                        <!-- 配置文件 -->
                        <script type="text/javascript" src="/admins/ueditor/ueditor.config.js"></script>
                        <!-- 编辑器源码文件 -->
                        <script type="text/javascript" src="/admins/ueditor/ueditor.all.js"></script>
                        <!-- 实例化编辑器 -->
                        <script type="text/javascript">
                            var ue = UE.getEditor('editor');
                        </script>
                    </div>
                    <input type="hidden" name="id" value="{{$article->id}}">
                    <button type="submit" class="btn btn-success"><i class="fa fa-check"></i> 更新</button>
                </div>
               {{csrf_field()}}
            </div>
        </form>
        </div>
    </div>
</section> 
@endsection